package com.yb.guigu.pick.security.bean;

import org.springframework.security.core.GrantedAuthority;

/**
 * Copyright (C), 2022-2023, 姚兵
 * Author: 32210
 * Date: 2023/5/31 16:02
 * FileName: GuiguPickGrantedAuthority
 * Description:
 */
public class GuiguPickGrantedAuthority implements GrantedAuthority {

    private String authority;

    public GuiguPickGrantedAuthority(){

    }

    public GuiguPickGrantedAuthority(String authority){

        this.authority=authority;

    }

    public void setAuthority(String authority){
        this.authority=authority;
    }

    @Override
    public String getAuthority() {
        return authority;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj instanceof GuiguPickGrantedAuthority) {
            return this.authority.equals(((GuiguPickGrantedAuthority) obj).authority);
        }
        return false;
    }

    @Override
    public int hashCode() {
        return this.authority.hashCode();
    }

    @Override
    public String toString() {
        return this.authority;
    }
}
